package customerEnter.Frame.daoTransaction;

import org.springframework.transaction.support.TransactionSynchronizationAdapter;

/**
 * 
 * 类描述： 事物處理
 * 
 * 类名称：MyTransactionSynchronizationAdapter
 * 
 * 创建人：dy
 * 
 * 创建时间：2017-7-27 下午3:32:06
 * 
 */

@SuppressWarnings("unused")
public class IcyTransaction extends TransactionSynchronizationAdapter {

	private IcyDataTemplateFactory	icyDataTemplateFactory;

	public IcyTransaction(IcyDataTemplateFactory icyDataTemplateFactory) {
		this.icyDataTemplateFactory = icyDataTemplateFactory;
	}

	@Override
	public void beforeCommit(boolean readOnly) {
		System.out.println("readOnly 是不是一个只读线程:" + readOnly);
	}

	@Override
	public void afterCompletion(int status) {
		if (STATUS_COMMITTED != status) {
			System.out.println("回滾 ");
		} else {
			System.out.println("提交 ");
		}
		System.out.println("關閉鏈接：");
	}

}
